package com.example.demo.service;

import com.example.demo.mapper.SwiperandfeedbackMapper;
import com.example.demo.pojo.Catrgoryicon;
import com.example.demo.pojo.Feedbackchuandi;
import com.example.demo.pojo.Swiperdata;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yanglup
 * @create 2020-12-04 21:44
 */
@Service
public class SwiperandfeedbackServiceImpl implements SwiperandfeedbackService {
    @Autowired
    SwiperandfeedbackMapper swiperandfeedbackMapper;


    /**查询轮播图*/
    @Override
    public List<Swiperdata> swiperdataback() {
        return swiperandfeedbackMapper.swiperdataback();
    }

    /**添加轮播图*/
    @Override
    public void Swiperaddbacktijiao(String image_src, String navigator_url) {
        swiperandfeedbackMapper.Swiperaddbacktijiao(image_src,navigator_url);
    }

    /**修改轮播图时查询*/
    @Override
    public Swiperdata Swiperupdate(Integer swiperdata_id) {
        return swiperandfeedbackMapper.Swiperupdate(swiperdata_id);
    }
    /**轮播图修改提交*/
    @Override
    public void Swiperupdatetijiao(Integer swiperdata_id1,Integer swiperdata_id2, String image_src, String navigator_url) {
        swiperandfeedbackMapper.Swiperupdatetijiao(swiperdata_id1,swiperdata_id2,image_src,navigator_url);
    }

    /**删除轮播图*/
    @Override
    public void Swiperdelete(Integer swiperdata_id) {
        swiperandfeedbackMapper.Swiperdelete(swiperdata_id);
    }

    /**算出总的条数*/
    @Override
    public Integer Swiperallnumber() {
        return swiperandfeedbackMapper.Swiperallnumber();
    }

    /**查询轮播图*/
    @Override
    public List<Swiperdata> Swiperqueryid(Integer swiperdata_id) {
        return swiperandfeedbackMapper.Swiperqueryid(swiperdata_id);
    }

    /**查询的轮播图数量*/
    @Override
    public Integer Swiperqueryidnumber(Integer swiperdata_id) {
        return swiperandfeedbackMapper.Swiperqueryidnumber(swiperdata_id);
    }


    /****************************************************反馈处理*********************************************************************************/
    /**查看反馈列表*/
    @Override
    public PageInfo<Feedbackchuandi> wxfeedbacklist(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Feedbackchuandi> mymycatrgoryicon= swiperandfeedbackMapper.wxfeedbacklist();
        PageInfo<Feedbackchuandi> myPageInfo=new PageInfo<Feedbackchuandi>(mymycatrgoryicon,pageSize);
        return myPageInfo;
    }
//    @Override
//    public List<Feedbackchuandi> wxfeedbacklist() {
//        return swiperandfeedbackMapper.wxfeedbacklist();
//    }
    /**列表数量*/
    @Override
    public Integer wxfeedbacklistnumber() {
        return swiperandfeedbackMapper.wxfeedbacklistnumber();
    }

    /**查看反馈页面*/
    @Override
    public Feedbackchuandi WXFeedbackcheck(Integer feedback_id) {
        return swiperandfeedbackMapper.WXFeedbackcheck(feedback_id);
    }

    /**删除反馈信息*/
    @Override
    public void WXFeedbackdelete(Integer feedback_id) {
        swiperandfeedbackMapper.WXFeedbackdelete(feedback_id);
    }
}
